%@brief Read topology from the file 
%@param [in] fn : Topology file name;
%@return topo : Topology, in array cell
%@return id2pos : containers.Map structure for storing Map from id 2
%pos
%@return pos2id : Array for storeing map from pos to id.


function acts=read_act_file(fn,topo)
ori_acts=load(fn);
[N,T]=size(ori_acts);
acts=zeros(N,T);
format long g
for n=1:N    
    tmp=ori_acts(n,:);
    result=zeros(size(tmp));
    friends=topo{n};
    
    for t=1:T
        if tmp(t)==0
            result(t)=0;
        else

            index=find(friends==tmp(t));
            if isempty(index)
                result(t)=0;
            else
                result(t)=index;
            end
        end
    end
    acts(n,:)=result;
end
format SHORT
end